//
//  SMTabButton.swift
//  SomePasti
//
//  Created by 李永彬 on 2025/10/7.
//

import SwiftUI

struct SMTabButton: View {
    let item: SMTabItem
    let isSelected: Bool
    let action: () -> Void
    
    var body: some View {
        Button(action: action) {
            VStack(spacing: 4) {
                if let icon = item.icon {
                    Image(systemName: icon)
                        .font(.system(size: 22))
                        .foregroundColor(isSelected ? item.color : Color(hex: "#848484"))
                }
                
                Text(item.title)
                    .font(.system(size: 15, weight: .bold))
                    .foregroundColor(isSelected ? item.color : Color(hex: "#848484"))
            }
            .frame(maxWidth: .infinity,
                   maxHeight: .infinity,
                   alignment: .top)
            .background(Color.clear)
            .padding(.top, 35)
        }
    }
}
